/** @file SpectatorController
    @class SpectatorController
    @brief Handles spectator mode

    Allows the user to control a camera object which can fly around and also watch from different players perspective
*/
#ifndef _SpectatorController_h_
#define _SpectatorController_h_

#include "Controller.h"
#include "CameraObject.h"
#include "InputObserver.h"
#include "Player.h"

class Player;

class SpectatorController : public Controller, public InputObserver {
public:
	/**
	* The constructor
	*/
  SpectatorController(Model* model, Ogre::RenderWindow* window, Ogre::Camera* camera);

	/**
	* The deconstructor
	*/
  virtual ~SpectatorController();


	/**
	* Handles movement and exit controls each update
	*/
  virtual bool update(float deltaTime);

	/**
	* Sets if this controller should be running or not
	*/
	virtual void setActive(bool in);
	
	/**
	* Sets the player which the controller is attached to
	*/
	void setPlayer(Player* p);
	
	/**
	* What should happen on key pressed
	*/
	bool keyPressed(const OIS::KeyEvent &arg);
	
	/**
	* What should happen on key released
	*/
	bool keyReleased(const OIS::KeyEvent &arg);
	
	/**
	* What should happen on mouse moved
	*/
	bool mouseMoved( const OIS::MouseEvent &arg );
	
	/**
	* What should happen on mouse pressed
	*/
	bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id );

private:
	/**
	* Reference to the camera
	*/
	Ogre::Camera* m_camera;
	
	/**
	* The SpectatorController's camerea object
	*/
	CameraObject* m_cObject;
	
	/**
	* The SpectatorController's player
	*/
	Player* player;
};

#endif
